import Vue from 'vue'
import Router from 'vue-router'


// 注册路由
Vue.use(Router)

import IndexPage from '@/pages/IndexPage'
import Detail from '@/pages/Detial'
import Analysis from '@/pages/detail/Analysis'
import Count from '@/pages/detail/Count'
import Forecast from '@/pages/detail/Forecast'
import Publish from '@/pages/detail/Publish'


export default new Router({
  mode: 'history', //设置路由为history 路由， 不再是哈希路由
  routes: [
    { path: '/', name: 'IndexPage', component: IndexPage },
    { 
      path: '/detail', 
      component: Detail,
      children: [
        { path: 'analysis', component: Analysis},
        { path: 'count', component: Count},
        { path: 'forecast', component: Forecast},
        { path: 'publish', component: Publish},
      ]
    }
  ]
})
